<template>
  <button @click="childMethod">子组件点击</button>
</template>

<script>
  export default {
    props: {
      fatherMethod: {
        type: Function,
        default: null
      }
    },
    methods: {
      childMethod() {
        if (this.fatherMethod) {
          this.fatherMethod();
        }
      }
    },
  }
</script>

<style scoped>

</style>
